package edu.mit.compilers.assembly.x64;

import edu.mit.compilers.assembly.x64.basic.X64Entry;

import java.util.HashMap;

public class X64AllocateMap {

    private HashMap<String, X64Entry> entryTable = new HashMap<>();
    private long stackAllocatedSize;

    // get stack size for variables (excluding register)
    public long getAllocatedStackSize() {
        return stackAllocatedSize;
    }

    public void setStackAllocatedSize(long stackAllocatedSize) {
        this.stackAllocatedSize = stackAllocatedSize;
    }

    public void put(String name, X64Entry entry) {
        // System.out.println(name + ":" + entry.size + " " + entry.location + entry.type);
        entryTable.put(name, entry);
    }

    public X64Entry get(String name) {
        return entryTable.get(name);
    }
}
